home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************************
- * Copyright © 1992-1993 Mark Pilgrim *
- * *
- * This file is provided as is, and may be freely distributed unaltered. This *
- * message must accompany any copy of this file. This file may be used or *
- * modified for use for a non-commercial product provided that appropriate *
- * credit is given to the author named above. *
- * Commercial use of this source code is prohibited. *
- ******************************************************************************/
-
- #include "msg misc.h"
- #include "msg timing.h"
-
- #define gap 14 /* width of strip */
- #define CorrectTime 1
-
- void CasteWipeRL(GrafPtr);
-
- /* This takes a strip (starting with the leftmost strip, moving right) and
- copies it into all the strips starting at the right and moving left until
- its in the right place. */
-
- void CasteWipeRL(GrafPtr sourceGrafPtr)
- {
- int srcx, barpos;
- Rect src, dest;
- Boolean everyOther;
-
- everyOther=FALSE;
- src.top = 0; /* constant */
- src.bottom = MAIN_WINDOW_HEIGHT; /* constant */
-
- for(srcx = 0; srcx < MAIN_WINDOW_WIDTH; srcx += gap)
- {
- for(barpos = 0; barpos + gap < MAIN_WINDOW_WIDTH; barpos += gap);
- for(; barpos >= srcx; barpos -= gap)
- {
- StartTiming();
- src.left = srcx;
- src.right = srcx + gap;
- dest = src;
- dest.left = barpos;
- dest.right = barpos + gap;
- CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
- &src, &dest, 0, 0L);
- if (everyOther) /* really, we need time */
- TimeCorrection(CorrectTime); /* correction 0.5, but */
- everyOther=!everyOther; /* this will do (gag) */
- }
- }
- }